package org.samoji.sji.model;
import java.math.BigDecimal;
import java.util.HashMap;


public class ExprSeq extends Expr {
	Expr[] seq;
	
	public ExprSeq(Expr... seq) {
		if(seq.length == 0) {
			throw new RuntimeException("Array cannot be length 0");
		} else {
			this.seq = seq;
		}
	}
	
	public static ExprSeq _(Expr... seq) {
		return new ExprSeq(seq);
	}

	@Override
	public BigDecimal evaluate(Env env) {
		/*for(Expr e : seq) {
			System.out.println(e.evaluate(env));
		}*/
		
		for(int i = 0; i < seq.length - 1; ++i) {
			seq[i].evaluate(env);
		}
		//return ;
		return seq[seq.length - 1].evaluate(env);
	}
}
